<?php
include_once "conn.php";

$qid=is_numeric($_GET['qid'])?$_GET['qid']:exit('No Qid!');
$rs = $db->query("SELECT * FROM ".DB_PREFIX."qqs where qid='{$qid}' and is3gqq>0 and sidzt=0 limit 1");
if($row=$rs->fetch()){
	$uin=$row['qq'];
	$sid=$row['sid'];
	$next=date("Y-m-d H:i:s",time()+60*5-10);
	@$db->exec("update ".DB_PREFIX."qqs set last3gqq='$now',next3gqq='$next' where qid='$qid'");
	@get_curl('http://pt.3g.qq.com/s?aid=nLogin3gqqbysid&3gqqsid='.$sid);
	@get_curl('http://q32.3g.qq.com/g/s?sid='.$sid.'&s=10&aid=chgStatus');
	exit('Ok!');
}else{
	exit('Qid Error!');
}
